
import 'package:flutter/material.dart';

class PageViewPage1 extends StatefulWidget {
  const PageViewPage1({super.key});
  @override
  State<PageViewPage1> createState() => _PageViewPageState();
}
class _PageViewPageState extends State<PageViewPage1> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text("pageview演示"),
        ),
        body: PageView(
// scrollDirection: Axis.vertical, // 滑动方向为垂直方向
        scrollDirection: Axis.vertical,
          children: [
            Center(
              child: Text("1",style: Theme.of(context).textTheme.headline1,),
            ),
            Center(
              child: Text("2",style: Theme.of(context).textTheme.headline1,),
            ),
            Center(
              child: Text("3",style: Theme.of(context).textTheme.headline1,),
            ),
            Center(
              child: Text("4",style: Theme.of(context).textTheme.headline1,),
            ),
            Center(
              child: Text("5",style: Theme.of(context).textTheme.headline1,),
            ),
            Center(
              child: Text("6",style: Theme.of(context).textTheme.headline1,),
            )
          ],
        ));
  }
}





